﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Input;
using Microsoft.Expression.Framework.Commands;
using Microsoft.Expression.Framework.UserInterface;

namespace BlendPluginManager
{
    public class PluginManagerCommand : Command, System.Windows.Input.ICommand
    {       
        #region ICommand Members

        private Palette panel;

        public PluginManagerCommand(Palette p)
        {
            panel = p;
        }

        bool System.Windows.Input.ICommand.CanExecute(object parameter)
        {
            return true;
        }

        event EventHandler System.Windows.Input.ICommand.CanExecuteChanged
        {
            add { }
            remove { }
        }

        void System.Windows.Input.ICommand.Execute(object parameter)
        {
            throw new NotImplementedException();
        }

        #endregion

        public override void Execute()
        {
            throw new NotImplementedException();
        }

        public override object GetProperty(string propertyName)
        {
            if (propertyName.Equals("IsChecked"))
            {
                return panel.IsVisible;
            }
            else
            {
                return base.GetProperty(propertyName);
            }
        }

        public override void SetProperty(string propertyName, object propertyValue)
        {
            if (propertyName.Equals("IsChecked"))
            {
                panel.IsVisible = (bool)propertyValue;
            }
            else
            {
                base.SetProperty(propertyName, propertyValue);
            }
        }

    }
}
